package com.hcg.initproject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Initproject05 提取到最外面后，只启动这个类，加上 @RestController 注解
 * 便可轻松访问本接口和其他接口
 */
@SpringBootApplication
@RestController
public class Initproject05 {
    protected static final Logger logger = LoggerFactory.getLogger(Initproject05.class);
    public static void main(String[] args) {

        logger.info("*******************开始服务******************");
        SpringApplication.run(Initproject05.class, args);
        logger.info("*******************启动服务完成******************");
    }

    @RequestMapping("/initpr")
    public String init(){
        int j = 1/0;
        logger.info("log4j 日志输出");
        return "hcg";
    }

}

